<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ZH-CN">
<head>
<title>毕业设计综合设置</title>
<meta http-equiv="X-UA-Compatible" content="IE=9" >
<meta name="keywords" content="吉珠,吉林大学,吉林大学珠海学院,吉林大学珠海学院论文管理">
<meta name="content-type" content="text/html" charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="<%=request.getContextPath()%>/pages1/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/pages1/css/flow.css" type="text/css">
<script src="<%=request.getContextPath()%>/pages1/js/jquery-2.1.1.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/pages1/js/bootstrap.js" type="text/javascript"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/gray/easyui.css" type="text/css"></link>
<link rel="stylesheet" href="<%=request.getContextPath()%>/jquery-easyui-1.4.1/themes/icon.css" type="text/css"></link>
<script type="text/javascript" src="<%=request.getContextPath()%>/jquery-easyui-1.4.1/locale/easyui-lang-zh_CN.js"></script>
<style>
.col-xs-3 {
	padding: 1px;
	height: 710px;
}
.col-xs-9 {
	height: 710px;
}
#xs12 {
	height: 604px;
	width: 313px;
}
</style>
<script type="text/javascript" language="javascript">
function g(o){return document.getElementById(o);}
function hoverli(n){
for(var i=1;i<=28;i++){
{g('tb_'+i).className='';}
g('tb_'+n).className='actived';}
}

function messageTable()
{
	console.info("1");
	var set_table= $('#setTable').datagrid({
		url:'<%=request.getContextPath()%>/setSecretary/setTable',
//		title:'综合设置',
		pagination : true,
		pageSize : 5,
		pageList : [ 5 ],
		singleSelect : true,
		fitColumns : true,
		rownumbers : true,
		columns : [ [
				{
					title : '系名称',
					field : 'department_name',
					width : 120,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.department_name;
						return a;
					}
				},
				{
					title : '教师人数',
					field : 'tchamount',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.tchamount;
						return a;
					}
				},
				{
					title : '学生人数',
					field : 'stuamount',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.stuamount;
						return a;
					}
				},
				{
					title : '学生/教师数量',
					field : 'department_tch_stu_num',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.department_tch_stu_num;
						var textBox = "<input type='text' id='setDtsn' style='width: 50px;color:#FF0000' value='"+a+"'>";
						return textBox;
					}
				},
				{
					title : '论文查重通过率',
					field : 'department_pass_percent',
					width : 60,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.department_pass_percent;
						var textBox = "<input type='text' id='setDpp' style='width: 50px; color:#FF0000' value='"+a+"'/> %";
						return textBox;
					}
				},
				{
					title : '论文进展报告篇/月',
					field : 'deparment_progress_month',
					width : 70,
					align : 'center',
//					editor: 'text',
					formatter : function(value, row, index) {
						var a = row.deparment_progress_month;
						var textBox = "<input type='text' id='setDpm' style='width: 50px; color:#FF0000;' value='"+a+"'/>";
						return textBox;
					}
				},
				{
					title : '操作',
					field : 'set',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = "<button type='button' class='btn btn-info btn-bg' onclick='setMessage()'>设置</button>";
						return a;
					}
				},
				]],
	});
}

function groupTable()
{
	console.info("1");
	var set_table= $('#groupTable').datagrid({
		url:'<%=request.getContextPath()%>/setSecretary/groupTable',
//		title:'综合设置',
		pagination : true,
		pageSize : 5,
		pageList : [ 5],
		singleSelect : true,
		fitColumns : true,
		rownumbers : true,
		columns : [ [
				{
					title : '系名称',
					field : 'department_name',
					width : 100,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.department_name;
						return a;
					}
				},
				{
					title : '教师工号',
					field : 'teacher_no',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.teacher_no;
						return a;
					}
				},
				{
					title : '教师姓名',
					field : 'teacher_name',
					width : 40,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.teacher_name;
						return a;
					}
				},
				{
					title : '专业方向',
					field : 'teacher_research',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.teacher_research;
						return a;
					}
				},
				{
					title : '职称/职位',
					field : 'zhicheng_name',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.zhicheng_name;
						return a;
					}
				},
				{
					title : '学历',
					field : 'teacher_xueli',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.teacher_xueli;
						return a;
					}
				},
				{
					title : '类别',
					field : 'teacher_category',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = row.teacher_category;
						return a;
					}
				},
				{
					title : '操作',
					field : 'delete',
					width : 50,
					align : 'center',
					formatter : function(value, row, index) {
						var a = "<button type='button' onclick='deleteGroup("+row.teacher_id+")' class='btn btn-danger btn-sm'>删除</button>";
						return a;
					}
				},
				]],
	});
}

$(function(){
	messageTable();
	groupTable();
	$('#teahcerList').combobox({
    	url:'<%=request.getContextPath()%>/setSecretary/groupTeacherList',
		valueField:'teacher_id',
		textField:'teacher_name',
		});
});

function setMessage() {
	var deparment_progress_month=document.getElementById("setDpm").value;
	var department_pass_percent=document.getElementById("setDpp").value;
	var department_tch_stu_num=document.getElementById("setDtsn").value;
	if(deparment_progress_month == null || deparment_progress_month=="")
		$.messager.alert('提示','请填入进展记录篇数');
		else if(department_pass_percent == null || department_pass_percent=="")
			$.messager.alert('提示','请填入查重通过率');
		else if(department_tch_stu_num == null || department_tch_stu_num=="")
			$.messager.alert('提示','请填入学生/教师人数');
		else
		{
			$.ajax({
				url:'<%=request.getContextPath()%>/setSecretary/setMessage',
				data:{
					"deparment_progress_month":deparment_progress_month,
					"department_pass_percent":department_pass_percent,
					"department_tch_stu_num":department_tch_stu_num,
				},
				success:function(r){
					if(r.success==true)
						$.messager.alert('提示','设置成功','info', function() {
							javascript: window.location.reload();
						});
					else
						$.messager.alert('提示','设置失败','info', function() {
								javascript: window.location.reload();
							});
				}
			});
		}
}

function setGroup() {
	var tchId=$('#teahcerList').combobox('getValue');
	var category=document.getElementById("groupType").value;
	if(tchId==""||tchId==null)
		$.messager.alert('提示', '请选择教师');
	else
	{
		$.ajax({
			url:'<%=request.getContextPath()%>/setSecretary/setGroup',
			data:{
				"tchId":tchId,
				"category":category,
			},
			success:function(r){
				if(r.success)
				{
					$('#groupTable').datagrid('reload');
					$('#teahcerList').combobox({
				    	url:'<%=request.getContextPath()%>/setSecretary/groupTeacherList',
						valueField:'teacher_id',
						textField:'teacher_name',
						});
				}
				else if(r.msg!=null)
					$.messager.alert('提示',r.msg);
				else
					$.messager.alert('提示','设置失败');
				
			},
		});
	}
}

function deleteGroup(tchId) {
	$.ajax({
		url:'<%=request.getContextPath()%>/setSecretary/deleteGroup',
		data:{
			"tchId":tchId,
		},
		success:function(r){
			if(r.success=true)
			{
				$('#groupTable').datagrid('reload');
				$('#teahcerList').combobox({
			    	url:'<%=request.getContextPath()%>/setSecretary/groupTeacherList',
					valueField:'teacher_id',
					textField:'teacher_name',
					});
			}
			else
				$.messager.alert('提示','删除失败');
		},
	});
	
}
		function showWhat()
		{
			var collap=document.getElementById('collapseHelp');
			if(collap.style.display=='none')
				collap.style.display='block';
			else
				collap.style.display='none';
		}
</script>
</head>

<body>
<!--全局框架 开始 conteiner-->
<div class="container"> 
  <!--标题头图片-->
  <div class="row">
    <div class="body_top"> <img src="<%=request.getContextPath()%>/pages1/img/head.png" align="center" width="1280px"/> </div>
  </div>
  <!--全局12栅格 规划全局区域图线 开始 row+ col-->
  <div class="row">
    <jsp:include page="secretary_siderbar.jsp"></jsp:include>
        <!--左侧跳转框架结束--> 
<!--右侧用户操作模块 占全局9栅格-->
<div class="col-xs-9"style="border:2px solid #25465d">
        <div class="row">
            <div class="col-xs-4  xs11" style="margin-top:2px; margin-bottom:0px;"> <strong><font size="3">流程管理》毕业设计综合设置	</font></strong> </div>
          </div>
                  <div class="col-xs-11  xs11" style="margin-top:2px; margin-bottom:0px;">
              <div class="panel panel-default" style="margin-top:2px; margin-bottom:10px;">
                <div class="panel-heading" align="left"> <a data-toggle="collapse" data-parent="#accordion"  href="#collapseHelp" class="glyphicon glyphicon-chevron-down" onclick="showWhat()"> 操作指南 </a> </div>
                <div id="collapseHelp" class="panel-collapse collapse">
                  <div class="panel-body">毕业设计综合设置：
            <ul>
              <li>设置本系每个教师可以带学生数量，论文查重通过率和学生论文进展报告每月多少篇。</li><br>
              <li>设置本系答辩小组组长和成员。提交后，可以通过查看导出系答辩小组名单。</li>
            </ul> </div>
                </div>
        </div>
        <div class="col-xs-12 " style="margin-top:5px; margin-bottom:10px;">
  <p><b>综合设置</b></p> 
             <table id="setTable" class="table table-hover table-bordered" style="margin-top:0px; margin-bottom:0px;" >
<!--  
<p>所属系名称:&nbsp&nbsp&nbsp&nbsp
                        <select>
                          <option value="1">计算机科学与技术系</option>
                          <option value="2">国际贸易与金融系</option>
                          <option value="3">物流管理系</option>
                          <option value="4">化学与药学系</option>
                          <option value="5">工商系</option>
                          <option value="6">艺术系</option>
                        </select>&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp 
                        
                所属专业名称：&nbsp&nbsp&nbsp&nbsp
                        <select>
                          <option value="1">计算机科学与技术专业</option>
                          <option value="2">软件工程专业</option>
                          <option value="3">网络工程专业</option>
                        </select> &nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp 
                        <button type="button" class="btn btn-info btn-sm">&nbsp;&nbsp;查询&nbsp;&nbsp;</button>    
                        </p> -->
 <!--              <thead>
                <th class="info" width="5%">No</th>
                <th class="info" width="15%">系名称</th>
                <th class="info"  width="10%">教师人数</th>
                <th class="info" width="10%">学生人数</th>
                 <th class="info" width="15%">学生/教师数量</th>
                  <th class="info" width="15%">论文查重通过率</th>
                   <th class="info" width="15%">论文进展报告篇/月</th>
                    <th class="info" width="5%">操作</th>
              </thead>
               
 
          
          
            <tbody> 
             <td>1</td>
             <td>计算机科学与技术系</td>
            <td>42</td>
            <td>415</td>
            <td><input type="text" size="10px"></td>
            <td><input type="text" size="10px">%</td>
            <td><input type="text" size="10px"></td>
            <td><button type="button" class="btn btn-warning btn-xs" onclick="javascript:window.location.reload() " value="刷新"/>设置</button></td>
            </tbody>
           -->
          </table>
          </div>
          
          <div class="col-xs-12">
          <p><b>系领导小组成员设置</b></p>
           
                          <p>所属系名称:&nbsp&nbsp&nbsp&nbsp
                        <select disabled="disabled">
                          <option value="1">计算机科学与技术系</option>
                        </select>&nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp 
                        
                教师姓名：&nbsp&nbsp&nbsp&nbsp
                
                        <input name="teahcerList" id="teahcerList" value="" style="width: 100px"/>
                        
                类别：&nbsp&nbsp&nbsp&nbsp
                        <select id="groupType">
                          <option value="组长">组长</option>
                          <option value="组员">组员</option>
                        </select> &nbsp&nbsp&nbsp&nbsp &nbsp&nbsp&nbsp&nbsp 
                        
                        <button type="button" class="btn btn-success btn-sm"  onclick="setGroup()" value="刷新"/>&nbsp;&nbsp;添加&nbsp;&nbsp;</button> 
                        </p>
              <table id="groupTable" class="table table-hover table-bordered" style="margin-top:0px; margin-bottom:0px;"> 
<!--               <thead>
                <th class="info" width="5%">No</th>
                <th class="info" width="15%">系名称</th>
                <th class="info"  width="10%">教师工号</th>
                <th class="info" width="10%">教师姓名</th>
                 <th class="info" width="15%">专业方向</th>
                  <th class="info" width="15%">职称/职位</th>
                   <th class="info" width="10%">学历</th>
                    <th class="info" width="10%">类别</th>
              </thead>
 
          
          
            <tbody> 
            <tr>
             <td>1</td>
             <td>计算机科学与技术系</td>
            <td>06008</td>
            <td>陈守孔</td>
            <td>计算机科学与技术</td>
            <td>教授/系主任</td>
            <td>本科</td>
            <td>组长</td>
            </tr>
            <tr>
                         <td>2</td>
             <td>计算机科学与技术系</td>
            <td>05082</td>
            <td>文全刚</td>
            <td>计算机科学与技术</td>
            <td>教授</td>
            <td>硕士</td>
            <td>组员</td>
            </tr>
            <tr>
                                     <td>3</td>
             <td>计算机科学与技术系</td>
            <td>05082</td>
            <td>傅晓阳</td>
            <td>计算机科学与技术</td>
            <td>教授</td>
            <td>博士</td>
            <td>组员</td>
            </tr>
            </tbody>
           --> 
          </table>
          
          </div>
           </div>
      

 </div>
  </div><!--修改结束--> 
      </div>
      <!--全局12栅格 规划全局区域图线 结束 row+ col--> 
    </div>
 
  <div class="row" style="background-color:#25465d"">
    <p  align="center" style="color:white;background-color:#25465d"><strong>用户单位：</strong>吉林大学珠海学院&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>版权所有：</strong>吉林大学珠海学院计算机科学与技术系</p>
  </div>
  <!--全局框架结束 conteiner--> 
</div>
</body>
</html>
